<template>
	<view class="container">
		<TopBtn :title="'设置'"></TopBtn>
		<view class="universal-card configurationBox">
			<view class="configuration flex-sp-center" @click="goinfo('pages/my/system/ChangePhone/ChangePhone')">
				<view class="">更换手机号</view>
				<view class="more">
					<uni-icons type="right" color="#999999" size="16"></uni-icons>
				</view>
			</view>
			<view class="configuration flex-sp-center" @click="Cache()">
				<view class="">清除缓存</view>
				<view class="more">
					<uni-icons type="right" color="#999999" size="16"></uni-icons>
				</view>
			</view>
		</view>
		<view class="universal-card configurationBox">
			<view class="configuration flex-sp-center" @click="quit()">
				<view class="">退出登录</view>
				<view class="more">
					<uni-icons type="right" color="#999999" size="16"></uni-icons>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	// import career from '@/static/career.js';

	export default {
		data() {
			return {
				// 活动状态
				act: 1,
				info: {},
			}
		},
		methods: {
			
			changeType(index) {
				console.log('当前选中的项：' + index)
			},
			Cache() {
				uni.showModal({
					title: '提示',
					content: '是否清除缓存,聊天记录也会被清除',
					success: function(res) {
						if (res.confirm) {
							uni.showToast({
								title: '清除成功',
								duration: 2000,
							})
						} else if (res.cancel) {
							console.log('用户点击取消')
						}
					},
				})
			},
			logout() {

			},
			quit() {
				uni.showModal({
					title: '提示',
					content: '是否退出登录',
					success: function(res) {
						if (res.confirm) {
							uni.clearStorage()
							uni.reLaunch({
								url: `../../login/login`,
							})
						} else if (res.cancel) {
							console.log('用户点击取消')
						}
					},
				})
			},

			goinfo(e, id) {
				if (id) {
					uni.navigateTo({
						url: `/${e}?id=${id}`,
					})
				} else {
					uni.navigateTo({
						url: `/${e}`,
					})
				}
			},
		},
	}
</script>

<style lang="less" scopde>
	.container {
		min-height: 80vh;

		.universal-card {
			background-color: #fff;
			width: 690rpx;
			margin: 0 auto 25rpx;
			padding: 24rpx 20rpx 19rpx;
			box-sizing: border-box;
			border-radius: 15rpx;
			min-height: 100rpx;
		}

		.configurationBox {
			margin-top: 20rpx;
			padding: 0 20rpx;

			.text {
				font-size: 28rpx;
				font-weight: 500;
				color: #333;
				line-height: 40rpx;
				padding: 30rpx 0;
			}
		}

		.configuration {
			font-size: 30rpx;
			font-weight: 500;
			color: #333333;
			height: 97rpx;
			border-bottom: 1px solid #eeeeee;

			&:last-child {
				border-bottom: none;
			}

			&>view {
				display: flex;
				align-items: center;
			}

			.more {
				font-size: 26rpx;
				color: #999999;
			}

			image {
				width: 33rpx;
				height: 33rpx;
				margin-right: 15rpx;
			}
		}

		.title {
			font-weight: bold;
			font-size: 30rpx;
		}
	}
</style>